function showJsVersion(){
  alert(ahAppBridge.version)
}

function nativeHaveMethod(){
  alert(ahAppBridge.hasNativeMethod(
  'base.toast',
  'asyn' //可选参数
  ));
}


//基础功能

//提示窗
function showToastClick() {
	ahAppBridge.base.toast({
		content: '请稍候'
	});
}

//状态栏颜色
function statusBar(){
  ahAppBridge.base.statusBar({
    color: '#ED4A4D'
  });
}

//选择菜单
function showMenu() {
	ahAppBridge.base.menu({
		title: '安恒移动-菜单',
		items: [{
				name: '选择一',
			},
			{
				name: '选择二'
			}
		],
		onClick: function(res) {
			var data = __parseJSON(res);
			alert(res);
			ahAppBridge.base.toast({
				content: '你点击了第 ' + data.index + ' 个 optionButton'
			}, function(res) {});
		}
	});
}

//打电话
function setDial(){
  ahAppBridge.base.communicate({
    type:"dial",
    num:"111" //可选参数
  },
  function(res) {alert(res)})
}

//发短信
function setSMS(){
  ahAppBridge.base.communicate({
    type:"sms",
    num:"111", //可选参数
    content:"I'm Arirus" //可选参数
  },
  function(res) {alert(res)})
}

//获取硬件信息
function getDeviceInfo(){
  ahAppBridge.base.deviceInfo(function(res){ alert(res)});
}
//获取软件信息
function getAppInfo(){
  ahAppBridge.base.appInfo(function(res){ alert(res)});
}

function exit() {
  ahAppBridge.base.exit();
}

function download() {
  ahAppBridge.base.download({
    url: 'https://fir.im/32x6',
    tag: 'app'
  });

}

function setSessionData(){
  ahAppBridge.base.setSession({
    data: {
      cities: [
        {
          cityName: '杭州',
          adCode: '330100',
          spell: ' hangzhou'
        }
      ],
      provinceName: '浙江省',
      countryName: '中国',
      name: 'Arirus',
    }
  },function(res) {alert(res)});
}

function getSessionData(){
  ahAppBridge.base.getSession('name', function(res) {
        alert(res.data.name);
  });
}


function showLoading() {
	ahAppBridge.toggle.func({
    'type':'loading',
    'tag':0,
    'content':'加载中，稍后'
    }
    ,function(res) {alert(res);}
   );
}

function hideLoading() {
    ahAppBridge.toggle.func({
    'type':'loading',
    'tag':1
    }
    ,function(res) {alert(res);}
   );
}

function showTitleBar() {
  ahAppBridge.toggle.func({
    'type':'titleBar',
    'tag':0
    }
    ,function(res) {alert(res);}
   );
}

function hideTitleBar() {
  ahAppBridge.toggle.func({
    'type':'titleBar',
    'tag':1
    }
    ,function(res) {alert(res);}
   );
}


function onAppStart() {
	ahAppBridge.toggle.func({
	  'type':'appStart',
	  'tag':0
	  }
	  ,function(res) {alert(res);}
	 );
}

function offAppStart() {
	ahAppBridge.toggle.func({
    'type':'appStart',
    'tag':1
    }
    ,function(res) {alert(res);}
   );
}


function onKeyboardSize() {
	ahAppBridge.toggle.func({
	  'type':'keyboardSize',
	  'tag':0
	  }
     ,function(res) {  var data = __parseJSON(res);
                           document.getElementById("KeyboardSizeValue").value = data.height;}
	 );
}

function offKeyboardSize() {
    ahAppBridge.toggle.func({
	  'type':'keyboardSize',
  	  'tag':1
  	  }
  	  ,function(res) {alert(res);}
  	 );
}

function onHomeClick() {
	ahAppBridge.toggle.func({
	  'type':'homeClick',
	  'tag':0
	  }
	  ,function(res) {alert(res);}
	 );
}

function offHomeClick() {
	ahAppBridge.toggle.func({
  	  'type':'homeClick',
  	  'tag':1
  	  }
  	  ,function(res) {alert(res);}
  	 );
}

function onProgressBar() {
	ahAppBridge.toggle.func({
	  'type':'progressBar',
	  'tag':0
	  }
	  ,function(res) {alert(res);}
	 );
}

function offProgressBar() {
	ahAppBridge.toggle.func({
  	  'type':'progressBar',
  	  'tag':1
  	  }
  	  ,function(res) {alert(res);}
  	 );
}



function onPushService() {
	ahAppBridge.toggle.func({
  	  'type':'pushService',
  	  'tag':0
  	  }
  	  ,function(res) {alert(res);}
  	 );
}

function offPushService() {
	ahAppBridge.toggle.func({
  	  'type':'pushService',
  	  'tag':1
  	  }
  	  ,function(res) {alert(res);}
  	 );
}

function onTitleClick() {
	ahAppBridge.toggle.func({
    'type':'titleClick',
    'tag':0
    }
    ,function(res) {alert(res);}
   );
}

function offTitleClick() {
	ahAppBridge.toggle.func({
    'type':'titleClick',
    'tag':1
    }
    ,function(res) {alert(res);}
   );
}

function onNetworkChange() {
	ahAppBridge.toggle.func({
    'type':'networkChange',
    'tag':0
    }
    ,function(res) {alert(res);}
   );
}

function offNetworkChange() {
	ahAppBridge.toggle.func({
    'type':'networkChange',
    'tag':1
    }
    ,function(res) {alert(res);}
   );
}


function setOptionButtonClick() {
	ahAppBridge.titleBar.setOptionButton({
		items: [{
				icon: 'https://zos.alipayobjects.com/rmsportal/QJeWMNUFFiDCQawMLPTr.png',
				badge: 0
			},
			{
				title: '颜色',
			}
		],

		onClick: function(res) {
			var data = __parseJSON(res);
			alert('你点击了第 ' + data.index + ' 个 optionButton');
		}
	});
}

function setOptionButtonNUllClick() {
	ahAppBridge.titleBar.setOptionButton({
		items: [],
		onClick: function(res) {}
	});
}

function setOptionLeftButtonClick() {
	ahAppBridge.titleBar.setOptionButton({
		items: [
			{
				icon: 'https://zos.alipayobjects.com/rmsportal/QJeWMNUFFiDCQawMLPTr.png',
				badge: 0
			},
			{
				title: '颜色',
			}
		],
		type: 'left',
		onClick: function(res) {
			var data = __parseJSON(res);
			alert(res);
			ahAppBridge.base.toast({
				content: '左边按钮,你点击了第 ' + data.index + ' 个 optionButton'
			}, function(res) {

			});
		}
	});
}

function setNavigationBar() {
	ahAppBridge.titleBar.setTitleBar({
		title: '设置导航栏背景色',
		backgroundColor: '#ED4A4D'
	}, function() {
		alert("收到回调");
	});
}

function showPopMenu() {
	ahAppBridge.titleBar.showPopMenu({
		items: [{
				title: '周边美食',
				icon: 'https://zos.alipayobjects.com/rmsportal/mzorSIxVEdkTuxumzzau.png'
			},
			{
				title: '购物攻略',
				icon: 'https://zos.alipayobjects.com/rmsportal/UoBNIZJosEXNQtAxCEUg.png'
			},
			{
				title: '摄影技巧',
				icon: 'https://zos.alipayobjects.com/rmsportal/QJeWMNUFFiDCQawMLPTr.png'
			},
			{
				title: '搞笑段子',
				icon: '',
				badge: '0'
			}
		],
		onClick: function(res) {
			var data = __parseJSON(res);
			ahAppBridge.base.toast({
				content: '你点击了第 ' + data.index + ' 个 optionButton'
			}, function(res) {});
		}
	});
}

function setPushAlias() {
	ahAppBridge.third.pushAlias({
		alias: '111'
	}, function(res) {
		alert(res);
	});
}

function setPushTags() {
	ahAppBridge.third.pushTags({
		tags: ['189','ggg','5sy']
	}, function(res) {
		alert(res);
	});
}

function clean() {
	ahAppBridge.third.pushClean(function(res) {
		alert(res);
	});
}

function locationClick() {
	ahAppBridge.third.location(function(res) {
		alert(res);
	});
}

function chooseImageClick() {
	ahAppBridge.third.chooseImage({
		count: 2
	}, function(res) {
		alert(JSON.stringify(res));
	});
}

function scanBtnClick() {
    ahAppBridge.third.scan({'title': '第三方页面',
       'navBackColor': '#345323',
      'backIcon': 'https://zos.alipayobjects.com/rmsportal/QJeWMNUFFiDCQawMLPTr.png',
    }, function(res) {
      var v = __parseJSON(res);
      alert(v.content);
    });
  }

//platform 可以不选 则默认打开一个控制面板 用户选择分享渠道
//选择的话 可以从 sms email weibo qq qqzone wechat wcmoments

//返回值其实就是分享sdk的回掉
function shareBtnClickQQ(){
  ahAppBridge.third.share({title:"分享到QQ",
  content:"这是百度首页",
  url:"https://www.baidu.com/",
  image:"https://www.baidu.com/s?wd=%E4%BB%8A%E6%97%A5%E6%96%B0%E9%B2%9C%E4%BA%8B&tn=SE_Pclogo_6ysd4c7a&sa=ire_dl_gh_logo&rsv_dl=igh_logo_pc",
  platform:"qq" },
    function(res) {
      alert(res.result);
    });
}

function shareBtnClickWC(){
  ahAppBridge.third.share({title:"分享到微信",
  content:"这是百度首页",
  url:"https://www.baidu.com/",
  image:"https://www.baidu.com/s?wd=%E4%BB%8A%E6%97%A5%E6%96%B0%E9%B2%9C%E4%BA%8B&tn=SE_Pclogo_6ysd4c7a&sa=ire_dl_gh_logo&rsv_dl=igh_logo_pc",
  platform:"wechat" },
    function(res) {
      alert(res.result);
    });
}

function shareBtnClickWCM(){
  ahAppBridge.third.share({title:"分享到朋友圈",
  content:"这是百度首页", //朋友圈不显示这栏，可以不发
  url:"https://www.baidu.com/",
  image:"https://www.baidu.com/s?wd=%E4%BB%8A%E6%97%A5%E6%96%B0%E9%B2%9C%E4%BA%8B&tn=SE_Pclogo_6ysd4c7a&sa=ire_dl_gh_logo&rsv_dl=igh_logo_pc",
  platform:"wechatmount" },
    function(res) {
      alert(res.result);
    });
}

function shareBtnClickWB(){
  ahAppBridge.third.share({title:"分享到微博",
  content:"这是百度首页",
  url:"https://www.baidu.com/",
  image:"https://www.baidu.com/s?wd=%E4%BB%8A%E6%97%A5%E6%96%B0%E9%B2%9C%E4%BA%8B&tn=SE_Pclogo_6ysd4c7a&sa=ire_dl_gh_logo&rsv_dl=igh_logo_pc",
  platform:"weibo" },
    function(res) {
      alert(res.result);
    });
}

function shareBtnClickDD(){
  ahAppBridge.third.share({title:"分享到微博",
  content:"这是百度首页",
  url:"https://www.baidu.com/",
  image:"https://www.baidu.com/s?wd=%E4%BB%8A%E6%97%A5%E6%96%B0%E9%B2%9C%E4%BA%8B&tn=SE_Pclogo_6ysd4c7a&sa=ire_dl_gh_logo&rsv_dl=igh_logo_pc",
  platform:"dingding" },
    function(res) {
      alert(res.result);
    });
}


function goThirdPartyWebClick() {
	ahAppBridge.third.thirdPartyWeb({
    'title': '第三方页面',
    'url': 'http://blog.csdn.net/yangchen9931/article/details/45599547',
    'navBackColor': '#345323',
    'backIcon': 'https://zos.alipayobjects.com/rmsportal/QJeWMNUFFiDCQawMLPTr.png',
    'closeIcon': 'https://sfault-avatar.b0.upaiyun.com/392/533/3925331066-578611c0cadde_big64'
  }, function(res) {
    var data = __parseJSON(res);
    alert(res);
  });
}













function showPdf(){
  ahAppBridge.showPdf({'url':'http://storm.websaas.cn/111.pdf'},function(res) {alert(res)})
}

function clickCustom(){
  ahAppBridge.clickCustom({index:"1"}, function(res) {alert(res)});
}



<!--********提示框*******start***************-->


//
//function showLoading() {
//	ahAppBridge.showLoading({
//		content: '请稍候···',
//		delay: 100
//	}, function(res) {
//		var res = __parseJSON(res);
//		<!--alert(res.msg);-->
//	});
//}
//
////todo 需要参数么？
//function hideLoading() {
//	ahAppBridge.hideLoading({
//		content: '关闭提示动画',
//		delay: 3000
//	}, function(res) {
//		var res = __parseJSON(res);
//		<!--alert(res.msg);-->
//	});
//}

// 测试修改



<!--********提示框**********end************-->